package com.wxp.controller;


import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by lewis on 2017/5/29.
 */
@Controller
public class IndexController {
    @RequestMapping("/login")
    public String index() {
        return "login";
    }


    @RequestMapping("/layui")
    public String indexLayui() {
        return "layui";

    }

    @RequestMapping("/bjui")
    public String bJui(){
        return "bjui";
    }

    @RequestMapping("/main")
    public String main() {
        return "main";
    }


    @RequestMapping("/getmenu")
    @ResponseBody
    public String getUser(Model model, HttpServletRequest request){



       String id = request.getParameter("pid");
       if(StringUtils.isEmpty(id)){
            return "[{title: \"系统管理\", icon: \"larry-xitongshezhi1\", pid: \"0\"},\n" +
                    "{title: \"内容管理\", icon: \"larry-neirongguanli\", pid: \"35\"},\n" +
                    "{title: \"微信公众\", icon: \"larry-weixingongzhongpingtai\", pid: \"40\"},\n" +
                    "{title: \"扩展模块\", icon: \"larry-ht_expand\", pid: \"46\"}]";
       }else{
            return "[{\"title\":\"\\u540e\\u53f0\\u9996\\u9875\",\"icon\":\"larry-houtaishouye\",\"href\":\"html\\/main.php\"},{\"title\":\"\n" +
                    "\\u6211\\u7684\\u9762\\u677f\",\"icon\":\"larry-gerenxinxi5\",\"spread\":\"true\",\"children\":[{\"title\":\"\\u4e2a\\u4eba\n" +
                    "\\u4fe1\\u606f\",\"icon\":\"larry-gerenxinxi1\",\"href\":\"html\\/personInfo.html\"},{\"title\":\"\\u4fee\\u6539\\u5bc6\n" +
                    "\\u7801\",\"icon\":\"larry-xiugaimima2\",\"href\":\"html\\/changepwd.html\"},{\"title\":\"\\u65e5\\u5fd7\\u4fe1\\u606f\"\n" +
                    ",\"icon\":\"larry-rizhi2\",\"href\":\"html\\/myloginfo.html\"}]},{\"title\":\"\\u7cfb\\u7edf\\u8bbe\\u7f6e\",\"icon\":\"larry-xitongshezhi1\"\n" +
                    ",\"spread\":\"true\",\"children\":[{\"title\":\"\\u7528\\u6237\\u7ba1\\u7406\",\"icon\":\"larry-10103\",\"href\":\"html\\/main\n" +
                    ".php\"},{\"title\":\"\\u89d2\\u8272\\u7ba1\\u7406\",\"icon\":\"larry-jiaoseguanli1\",\"href\":\"html\\/temp.html\"},{\"title\"\n" +
                    ":\"\\u83dc\\u5355\\u7ba1\\u7406\",\"icon\":\"larry-caidanguanli\",\"href\":\"html\\/temp.html\"},{\"title\":\"\\u7cfb\\u7edf\n" +
                    "\\u53c2\\u6570\\u914d\\u7f6e\",\"icon\":\"larry-circularxiangxi\",\"href\":\"html\\/temp.html\"},{\"title\":\"\\u7cfb\\u7edf\n" +
                    "\\u914d\\u7f6e\\u7ba1\\u7406\",\"icon\":\"larry-circularxiangxi\",\"href\":\"html\\/temp.html\"}]},{\"title\":\"\\u9879\n" +
                    "\\u76ee\\u6587\\u6863\",\"icon\":\"larry-huiyuanguanli2\",\"spread\":\"true\",\"children\":[{\"title\":\"\\u9879\\u76ee\n" +
                    "\\u56fe\\u6807\\u793a\\u4f8b\",\"icon\":\"larry-kehuliebiao\",\"href\":\"html\\/icondemo.html\"},{\"title\":\"\\u6587\\u6863\n" +
                    "\\u53c2\\u6570\\u8bf4\\u660e\",\"icon\":\"larry-liuyan\",\"href\":\"html\\/doc.html\"}]}]";
       }

    }


}
